<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        function onclickway(){
            var mima = document.getElementById("mima");
            var input1 = document.getElementById("input1");
            var input2 = document.getElementById("input2");
            var zhanghao = document.getElementById("zhanghao");
            if (mima.value != "025110"){
                input1.innerHTML = "密码错误！";
            }
            if (zhanghao.value != "20034460315"){
                input2.innerHTML = "账号有误！";
            }
            if ((mima.value == "025110")&&(zhanghao.value == "20034460315")){
                alert("登陆成功！");
                window.location.href='http://www.baidu.com';
            }
        }
    </script>
    <style type="text/css">
        #id002{
            width: 380px;
            height: 200px;
            /* 设置内容区 */
            border: 3px lightcoral solid;
            /* 设置边框 */
            padding: 15px;
            /* 设置内边距 */
            margin: 200px auto;
            /* 设置外边距，上外边距为200px,左右外边距相等，从而使其居中 */
            color: blueviolet;
        }
        #id001{
            color: rgb(211, 19, 83);
        }
        .a1{
            width: 10px;
            height: 10px;
            /* background-color: aquamarine; */
            margin-left: 170px;
        }
    </style>
</head>
<body>
    <div id="id002">
        用户账号：
        <input type="text" id="zhanghao" value="考生号">
        <span id="input2" ></span><br/><br/>
        用户密码：
        <input type="text" id="mima" value="身份证后六位">
        <span id="input1" ></span>
        <br/><br/><input type="button" value="登录" onclick="onclickway();" id="id001">
        <a href="" class="a1">注册</a>
    </div>
</body>
</html>